package com.itheima.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;

@Component
//使用 @ConfigurationProperties 注解 定义当前实体类读取配置属性信息

@ConfigurationProperties(prefix = "jdbc")
public class jdbc {
    private String username;
    private String driver;
    private String url;
    private String password;
    private String[] subject;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String[] getSubject() {
        return subject;
    }

    public void setSubject(String[] subject) {
        this.subject = subject;
    }

    @Override
    public String toString() {
        return "jdbc{" +
                "username='" + username + '\'' +
                ", driver='" + driver + '\'' +
                ", url='" + url + '\'' +
                ", password='" + password + '\'' +
                ", subject=" + Arrays.toString(subject) +
                '}';
    }
}
